package com.dingwen.treasure.kettle.vo;

import com.dingwen.treasure.kettle.base.tree.BaseTree;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * 　CategoryVo
 * 　@author dingwen
 * 　@date 2022/8/21
 */
@ApiModel(value = "CategoryVo", description = "资源库目录视图对象")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Accessors(chain = true)
@JsonIgnoreProperties(ignoreUnknown = true)
public class CategoryVo implements Serializable, BaseTree {

    private static final long serialVersionUID = 1046430148788831424L;


    /**
     * 目录ID
     */
    @ApiModelProperty(value = "目录ID")
    private String id;

    /**
     * 父目录ID
     */
    @ApiModelProperty(value = "父目录ID")
    private String parentId;

    /**
     * 目录名称
     */
    @ApiModelProperty(value = "目录名称")
    private String categoryName;

    /**
     * 目录路径
     */
    @ApiModelProperty(value = "目录路径")
    private String categoryPath;


    /**
     * 子目录
     */
    @ApiModelProperty(value = "子目录")
    private List<CategoryVo> children;

    /**
     * 设置子项(数据中转)
     *
     * @param children 儿童
     */
    @Override
    public void setChildren(List children) {
        this.children = children;
    }

    /**
     * 获取子项(数据中转)
     *
     * @return {@link List}
     */
    @Override
    public List getChildren() {
        return children;
    }

    /**
     * 获取当前元素ID
     *
     * @return {@link Long}
     */
    @Override
    public String getId() {
        return id;
    }

    /**
     * 获取树参数id
     *
     * @return {@link Long}
     */
    @Override
    public String getParenId() {
        return parentId;
    }
}
